import { observable, action, autorun, toJS } from 'mobx';
import { WeaLocaleProvider } from 'ecCom';
import {WeaForm, WeaTableNew} from 'comsMobx'
import {message, Button } from "antd";
import { ListStore } from '../listStore';
import * as Apis from '../../apis/info';

const {TableStore} = WeaTableNew;
const getLabel = WeaLocaleProvider.getLabel;
export class rewardListStore{

    @observable tableStore = new TableStore();      //筛选，特殊采用列表store

    @observable status = {
        visible: false,     //历史加分记录dialog的visible
    }

    parent = null;
    constructor(parent) {
      this.parent = parent;
   }

    setState = (params = {}) => {
        Object.keys(params).forEach(o => {
            this.status[o] = params[o];
        })
        return this;
    }

    //初始化历史加分项tableStore
    @action
    getRewardList = (params = {}) => {
        let newParams = {...params};
        Apis.getRewardList(newParams).then(data => {
            if (data.api_status == '1') {
                this.tableStore.getDatas(data.sessionkey, 1);
            } else {
                message.error(data.api_errormsg);
            }
            
        });
    }

}